package com.dl7.mvp.injector.modules;

import com.dl7.mvp.adapter.BaseVideoListAdapter;
import com.dl7.mvp.injector.PerFragment;
import com.dl7.mvp.module.base.IBasePresenter;
import com.dl7.mvp.module.base.IRxBusPresenter;
import com.dl7.mvp.module.video.list.AlbumsFragment;
import com.dl7.mvp.module.video.list.AlbumsPresenter;
import com.dl7.mvp.rxbus.RxBus;
import com.dl7.recycler.adapter.BaseQuickAdapter;

import dagger.Module;
import dagger.Provides;

/**
 * 专辑视频对应的video列表
 */
@Module
public class AlbumsModule {

    private final AlbumsFragment mView;
    private final int mID;
    private BaseVideoListAdapter mAdapter;

    public AlbumsModule(AlbumsFragment view, int id) {
        this.mView = view;
        this.mID = id;
    }

    @PerFragment
    @Provides
    public IRxBusPresenter providePresenter(RxBus rxBus) {
        return new AlbumsPresenter(mView, mID, rxBus);
    }

    @PerFragment
    @Provides
    public BaseVideoListAdapter provideAdapter() {
        mAdapter = new BaseVideoListAdapter(mView.getContext());
        return mAdapter;
    }
}
